//
//  MYCmymoneylogViewModel.m
//  meiyinxiang
//
//  Created by 陈李飞 on 2017/11/30.
//  Copyright © 2017年 hbjApple. All rights reserved.
//

#import "MYCmymoneylogViewModel.h"

@implementation MYCmymoneylogViewModel
- (void)loadCmymoneylog:(int)PageIndex
             WithResult:(CmymoneylogBlock)result{
    if (self.CmymoneylogArray == nil) {
        self.CmymoneylogArray = [NSMutableArray array];
    }
//    if (self.CmymoneylogArray.count > 0) {
//        [self.CmymoneylogArray removeAllObjects];
//    }
    [[MYXHttpManager shared] mymoneylog:PageIndex withResult:^(BOOL success, NSString *msg, NSArray *arrays) {
        if (success) {
            if (arrays.count>0) {
                    [self.CmymoneylogArray addObjectsFromArray:arrays];
                result(YES);

            }else{
                result(NO);
            }
        }else{
            result(NO);
        }
        
    } errorResult:^(NSError *enginerError) {
        result(NO);
    }];
}

@end
